public class Unit
{
    /// <summary>
    /// 获取单位ID
    /// </summary>
    /// <returns>单位ID</returns>
    public extern int? api_get_id();

    /// <summary>
    /// 获取单位编号
    /// </summary>
    /// <returns>单位编号</returns>
    public extern int? api_get_key();

    /// <summary>
    /// 获取单位所属阵营id
    /// </summary>
    /// <returns>阵营ID</returns>
    public extern int? api_get_camp_id();

    /// <summary>
    /// 获取单位所属玩家ID
    /// </summary>
    /// <returns>玩家ID</returns>
    public extern int? api_get_role_id();

    /// <summary>
    /// 获取单位所属玩家
    /// </summary>
    /// <returns>玩家</returns>
    public extern Role api_get_role();

    /// <summary>
    /// 获取单位所属阵营
    /// </summary>
    /// <returns>阵营</returns>
    public extern Camp api_get_camp();

    /// <summary>
    /// 获取单位类型
    /// </summary>
    /// <returns>单位类型</returns>
    public extern int? api_get_type();

    /// <summary>
    /// 获取单位名称
    /// </summary>
    /// <returns>单位名称</returns>
    public extern string api_get_name();

    /// <summary>
    /// 添加定时器
    /// </summary>
    /// <param name="time"> 定时时长 </param>
    /// <param name="callback"> 超时函数 </param>
    /// <returns>定时器ID</returns>
    public extern int? add_timer(Fix32 time,dynamic callback);

    /// <summary>
    /// 添加周期定时器
    /// </summary>
    /// <param name="time"> 定时时长 </param>
    /// <param name="callback"> 超时函数 </param>
    /// <returns>定时器ID</returns>
    public extern int? add_repeat_timer(Fix32 time,dynamic callback);

    /// <summary>
    /// 取消定时器
    /// </summary>
    /// <param name="timer_id"> 定时器ID </param>
    /// <returns></returns>
    public extern void cancel_timer(int? timer_id);

    /// <summary>
    /// 单位移除键值对
    /// </summary>
    /// <param name="k"> 键名 </param>
    /// <returns></returns>
    public extern void api_remove_kv(string k);

    /// <summary>
    /// 单位是否存活
    /// </summary>
    /// <returns>单位是否存活</returns>
    public extern bool? api_is_alive();

    /// <summary>
    /// 隐藏头顶信息
    /// </summary>
    /// <param name="show"> 是否隐藏头顶信息 </param>
    /// <returns></returns>
    public extern void api_hide_head_bar(bool? show);

    /// <summary>
    /// 单位是否拥有标签
    /// </summary>
    /// <param name="tag"> 标签 </param>
    /// <returns>单位是否拥有标签</returns>
    public extern bool? has_tag(string tag);

    /// <summary>
    /// 复活单位
    /// </summary>
    /// <param name="position"> 复活位置 </param>
    /// <returns></returns>
    public extern void api_revive(Point position);

    /// <summary>
    /// 单位是否已销毁
    /// </summary>
    /// <returns>单位是否已销毁</returns>
    public extern bool? api_is_destroyed();

    /// <summary>
    /// 删除单位
    /// </summary>
    /// <returns></returns>
    public extern void api_delete();

    /// <summary>
    /// 强制单位死亡
    /// </summary>
    /// <param name="source_unit"> 杀手单位 </param>
    /// <returns></returns>
    public extern void api_kill(Unit source_unit);

    /// <summary>
    /// 获取单位图标路径
    /// </summary>
    /// <returns>单位图标路径</returns>
    public extern string api_get_icon();

    /// <summary>
    /// 获取单位图片路径
    /// </summary>
    /// <param name="pic_type"> 图片类型 </param>
    /// <returns>单位图片路径</returns>
    public extern string api_get_unit_pic(string pic_type);

    /// <summary>
    /// 获取单位的父单位
    /// </summary>
    /// <returns>单位的父单位</returns>
    public extern Unit api_get_parent_unit();

    /// <summary>
    /// 改变单位血条颜色
    /// </summary>
    /// <param name="color"> 单位血条颜色值 </param>
    /// <returns></returns>
    public extern void api_set_hp_color(string color);

    /// <summary>
    /// 开启/关闭伤害及助攻统计
    /// </summary>
    /// <param name="enable"> 开启 </param>
    /// <returns></returns>
    public extern void api_switch_atk_assist_record(bool? enable);

    /// <summary>
    /// 单位/点是否在范围内
    /// </summary>
    /// <param name="unit"> 单位 </param>
    /// <param name="radius"> 范围 </param>
    /// <returns>是否在范围内</returns>
    public extern bool? api_is_in_range(Unit unit,double? radius);

    /// <summary>
    /// 点是否在范围内
    /// </summary>
    /// <param name="point"> 点 </param>
    /// <param name="radius"> 范围 </param>
    /// <returns>是否在范围内</returns>
    public extern bool? api_is_point_in_range(Point point,double? radius);

    /// <summary>
    /// 设置单位生命周期
    /// </summary>
    /// <param name="life_time"> 生命周期 </param>
    /// <returns></returns>
    public extern void api_set_life_cycle(double? life_time);

    /// <summary>
    /// 暂停单位生命周期
    /// </summary>
    /// <param name="pause"> 是否暂停 </param>
    /// <returns></returns>
    public extern void api_pause_life_cycle(bool? pause);

    /// <summary>
    /// 获取单位当前生命周期
    /// </summary>
    /// <returns>生命周期</returns>
    public extern Fix32 api_get_life_cycle();

    /// <summary>
    /// 获取单位总生命周期时长
    /// </summary>
    /// <returns>生命周期</returns>
    public extern Fix32 api_get_total_life_cycle();

    /// <summary>
    /// 设置单位攻击类型
    /// </summary>
    /// <param name="attack_type"> 攻击类型 </param>
    /// <returns></returns>
    public extern void api_set_attack_type(int? attack_type);

    /// <summary>
    /// 获取单位攻击类型
    /// </summary>
    /// <returns>攻击类型</returns>
    public extern int? api_get_atk_type();

    /// <summary>
    /// 攻击类型判断
    /// </summary>
    /// <param name="attack_type"> 攻击类型 </param>
    /// <returns>攻击类型判断</returns>
    public extern bool? api_is_attack_type(int? attack_type);

    /// <summary>
    /// 设置单位护甲类型
    /// </summary>
    /// <param name="armor_type"> 护甲类型 </param>
    /// <returns></returns>
    public extern void api_set_armor_type(int? armor_type);

    /// <summary>
    /// 获取单位护甲类型
    /// </summary>
    /// <returns>护甲类型</returns>
    public extern int? api_get_armor_type();

    /// <summary>
    /// 护甲类型判断
    /// </summary>
    /// <param name="armor_type"> 护甲类型 </param>
    /// <returns>护甲类型判断</returns>
    public extern bool? api_is_armor_type(int? armor_type);

    /// <summary>
    /// 获取单位的x轴缩放
    /// </summary>
    /// <returns>缩放的值</returns>
    public extern double? api_get_x_scale();

    /// <summary>
    /// 获取单位的y轴缩放
    /// </summary>
    /// <returns>缩放的值</returns>
    public extern double? api_get_y_scale();

    /// <summary>
    /// 获取单位的z轴缩放
    /// </summary>
    /// <returns>缩放的值</returns>
    public extern double? api_get_z_scale();

    /// <summary>
    /// 获取单位的仇恨单位
    /// </summary>
    /// <returns>仇恨的单位</returns>
    public extern Unit api_get_ai_battle_target_unit();

    /// <summary>
    /// 获取单位的跟随单位
    /// </summary>
    /// <returns>跟随的单位</returns>
    public extern Unit api_get_ai_follow_target_unit();

    /// <summary>
    /// 获取 attr_other
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_other(string key);

    /// <summary>
    /// 获取attr_base
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_base(string key);

    /// <summary>
    /// 获取attr_base_ratio
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_base_ratio(string key);

    /// <summary>
    /// 获取attr_bonus
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_bonus(string key);

    /// <summary>
    /// 获取attr_bonus_ratio
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_bonus_ratio(string key);

    /// <summary>
    /// 获取attr_all_ratio
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr_all_ratio(string key);

    /// <summary>
    /// 获取单位主属性
    /// </summary>
    /// <returns>主属性</returns>
    public extern string api_get_main_attr();

    /// <summary>
    /// 设置纯值类型的值
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 值 </param>
    /// <returns></returns>
    public extern void api_set_attr(string key,Fix32 val);

    /// <summary>
    /// 设置单位属性（根据属性分类）
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 值 </param>
    /// <param name="attr_element"> 属性分类 </param>
    /// <returns></returns>
    public extern void api_set_attr_by_attr_element(string key,Fix32 val,string attr_element);

    /// <summary>
    /// 设置单位属性基础值部分
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 基础值 </param>
    /// <returns></returns>
    public extern void api_set_attr_base(string key,Fix32 val);

    /// <summary>
    /// 增加单位属性（根据属性分类）
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 值 </param>
    /// <param name="attr_element"> 属性分类 </param>
    /// <returns></returns>
    public extern void api_add_attr_by_attr_element(string key,Fix32 val,string attr_element);

    /// <summary>
    /// 增加单位属性基础值
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="delta"> 增加值 </param>
    /// <returns></returns>
    public extern void api_add_attr_base(string key,Fix32 delta);

    /// <summary>
    /// 设置单位属性 attr_bonus
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 设置值 </param>
    /// <returns></returns>
    public extern void api_set_attr_bonus(string key,Fix32 val);

    /// <summary>
    /// 增加单位属性 attr_bonus
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="delta"> 增加值 </param>
    /// <returns></returns>
    public extern void api_add_attr_bonus(string key,Fix32 delta);

    /// <summary>
    /// 设置单位属性 attr_bouns_ratio
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 设置值 </param>
    /// <returns></returns>
    public extern void api_set_attr_bonus_ratio(string key,Fix32 val);

    /// <summary>
    /// 增加单位属性 attr_bouns_ratio
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="delta"> 加成比例 </param>
    /// <returns></returns>
    public extern void api_add_attr_bonus_ratio(string key,Fix32 delta);

    /// <summary>
    /// 设置单位属性 基础值和额外值 加成比例
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 设置值 </param>
    /// <returns></returns>
    public extern void api_set_attr_all_ratio(string key,Fix32 val);

    /// <summary>
    /// 增加单位属性 基础值和额外值 加成比例
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="delta"> 加成比例 </param>
    /// <returns></returns>
    public extern void api_add_attr_all_ratio(string key,Fix32 delta);

    /// <summary>
    /// 设置单位属性 基础值 加成比例
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="val"> 设置值 </param>
    /// <returns></returns>
    public extern void api_set_attr_base_ratio(string key,Fix32 val);

    /// <summary>
    /// 增加单位属性基础值百分比加成
    /// </summary>
    /// <param name="key"> 属性名 </param>
    /// <param name="delta"> 加成比例 </param>
    /// <returns></returns>
    public extern void api_add_attr_base_ratio(string key,Fix32 delta);

    /// <summary>
    /// 设置单位等级
    /// </summary>
    /// <param name="level"> 等级 </param>
    /// <returns></returns>
    public extern void api_set_level(int? level);

    /// <summary>
    /// 增加单位等级
    /// </summary>
    /// <param name="level"> 等级 </param>
    /// <returns></returns>
    public extern void api_add_level(int? level);

    /// <summary>
    /// 获取单位实数属性
    /// </summary>
    /// <param name="key"> 属性类型 </param>
    /// <param name="attr"> 属性名 </param>
    /// <returns>实数属性值</returns>
    public extern Fix32 api_get_attr(string key,string attr);

    /// <summary>
    /// 获取单位实数属性
    /// </summary>
    /// <param name="attr"> 属性名 </param>
    /// <returns>实数属性值</returns>
    public extern Fix32 api_get_float_attr(string attr);

    /// <summary>
    /// 获取单位字符串属性
    /// </summary>
    /// <param name="attr"> 属性名 </param>
    /// <returns>字符串属性值</returns>
    public extern string api_get_str_attr(string attr);

    /// <summary>
    /// 设置单位字符串属性
    /// </summary>
    /// <param name="attr"> 属性名 </param>
    /// <param name="value"> 字符串值 </param>
    /// <returns></returns>
    public extern void api_set_str_attr(string attr,string value);

    /// <summary>
    /// 获取单位等级
    /// </summary>
    /// <returns>单位等级</returns>
    public extern int? api_get_level();

    /// <summary>
    /// 获取单位血量
    /// </summary>
    /// <returns>单位血量</returns>
    public extern Fix32 api_get_hp();

    /// <summary>
    /// 获取单位血量百分比
    /// </summary>
    /// <returns>单位血量百分比</returns>
    public extern Fix32 api_get_hpp();

    /// <summary>
    /// 治疗单位
    /// </summary>
    /// <param name="hp_change"> 治疗的数值 </param>
    /// <param name="jump_word"> 是否跳字 </param>
    /// <param name="related_ability"> 关联技能 </param>
    /// <param name="source_unit"> 来源单位 </param>
    /// <param name="harm_text_enum"> 跳字枚举 </param>
    /// <param name="jump_word_track"> 跳字轨迹 </param>
    /// <returns></returns>
    public extern void api_heal(Fix32 hp_change,bool? jump_word,Ability related_ability,Unit source_unit,string harm_text_enum,int? jump_word_track);

    /// <summary>
    /// 获取输出伤害统计值
    /// </summary>
    /// <returns>输出伤害统计值</returns>
    public extern Fix32 api_get_dmg_statistics();

    /// <summary>
    /// 清空输出伤害统计值
    /// </summary>
    /// <returns></returns>
    public extern void api_clear_dmg_statistics();

    /// <summary>
    /// 增加经验，增加值为正数
    /// </summary>
    /// <param name="exp"> 经验 </param>
    /// <returns></returns>
    public extern void api_add_exp(Fix32 exp);

    /// <summary>
    /// 设置经验
    /// </summary>
    /// <param name="exp"> 经验 </param>
    /// <returns></returns>
    public extern void api_set_exp(Fix32 exp);

    /// <summary>
    /// 获取单位当前经验, 如果达到了顶级，就返回-1
    /// </summary>
    /// <returns>单位当前经验值</returns>
    public extern int? api_get_exp();

    /// <summary>
    /// 获取当前升级所需经验, 如果达到了顶级，就返回-1
    /// </summary>
    /// <returns>当前升级所需经验值</returns>
    public extern int? api_get_upgrade_exp();

    /// <summary>
    /// 单位移除键值对
    /// </summary>
    /// <param name="tag"> TAG </param>
    /// <returns></returns>
    public extern void api_add_tag(string tag);

    /// <summary>
    /// 单位移除键值对
    /// </summary>
    /// <param name="tag"> TAG </param>
    /// <returns></returns>
    public extern void api_remove_tag(string tag);

    /// <summary>
    /// 设置单位删除时是否回收
    /// </summary>
    /// <param name="recycle"> 是否回收 </param>
    /// <returns></returns>
    public extern void api_set_recycle_on_remove(bool? recycle);

    /// <summary>
    /// 设置单位名称
    /// </summary>
    /// <param name="name"> 名称 </param>
    /// <returns></returns>
    public extern void api_set_name(string name);

    /// <summary>
    /// 设置单位白天视野
    /// </summary>
    /// <param name="value"> 视野 </param>
    /// <returns></returns>
    public extern void api_set_unit_day_vision(double? value);

    /// <summary>
    /// 获取单位白天视野
    /// </summary>
    /// <returns>白天视野</returns>
    public extern Fix32 api_get_unit_day_vision();

    /// <summary>
    /// 设置单位夜晚视野
    /// </summary>
    /// <param name="value"> 视野 </param>
    /// <returns></returns>
    public extern void api_set_unit_night_vision(double? value);

    /// <summary>
    /// 获取单位夜晚视野
    /// </summary>
    /// <returns>夜晚视野</returns>
    public extern Fix32 api_get_unit_night_vision();

    /// <summary>
    /// 设置单位警戒范围
    /// </summary>
    /// <param name="value"> 警戒范围 </param>
    /// <returns></returns>
    public extern void api_set_unit_alarm_range(double? value);

    /// <summary>
    /// 获取单位警戒范围
    /// </summary>
    /// <returns>警戒范围</returns>
    public extern Fix32 api_get_unit_alarm_range();

    /// <summary>
    /// 设置单位取消警戒范围
    /// </summary>
    /// <param name="value"> 取消警戒范围 </param>
    /// <returns></returns>
    public extern void api_set_unit_cancel_alarm_range(double? value);

    /// <summary>
    /// 获取单位取消警戒范围
    /// </summary>
    /// <returns>取消警戒范围</returns>
    public extern Fix32 api_get_unit_cancel_alarm_range();

    /// <summary>
    /// 获取单位物品栏数量
    /// </summary>
    /// <returns>数量</returns>
    public extern int? api_get_unit_bar_cnt();

    /// <summary>
    /// 获取单位背包栏数量
    /// </summary>
    /// <returns>数量</returns>
    public extern int? api_get_unit_pkg_cnt();

    /// <summary>
    /// 获取单位动态碰撞半径
    /// </summary>
    /// <returns>动态碰撞半径</returns>
    public extern Fix32 api_get_unit_collision_radius();

    /// <summary>
    /// 获取单位被击杀经验
    /// </summary>
    /// <returns>经验值</returns>
    public extern int? api_get_unit_reward_exp();

    /// <summary>
    /// 获取单位被击杀的玩家属性
    /// </summary>
    /// <param name="res_key"> 玩家属性资源 </param>
    /// <returns>经验值</returns>
    public extern Fix32 api_get_unit_reward_res(string res_key);

    /// <summary>
    /// 设置单位被击杀经验
    /// </summary>
    /// <param name="res_value"> 经验值 </param>
    /// <returns></returns>
    public extern void api_set_unit_reward_exp(Fix32 res_value);

    /// <summary>
    /// 设置单位被击杀的玩家属性
    /// </summary>
    /// <param name="res_key"> 玩家属性资源 </param>
    /// <param name="res_value"> 经验值 </param>
    /// <returns></returns>
    public extern void api_set_unit_reward_res(string res_key,Fix32 res_value);

    /// <summary>
    /// 获取单位的护盾值
    /// </summary>
    /// <param name="shield_type"> 护盾类型 </param>
    /// <returns>护盾值</returns>
    public extern int? api_get_unit_shield_value(int? shield_type);

    /// <summary>
    /// 设置单位的头像
    /// </summary>
    /// <param name="icon"> 图片 </param>
    /// <returns></returns>
    public extern void api_set_unit_icon(int? icon);

    /// <summary>
    /// 获取单位主属性
    /// </summary>
    /// <returns>属性</returns>
    public extern string api_get_unit_main_attr();

    /// <summary>
    /// 单位停止移动
    /// </summary>
    /// <returns></returns>
    public extern void api_stop_move();

    /// <summary>
    /// 单位传送到指定坐标
    /// </summary>
    /// <param name="point"> 目标坐标 </param>
    /// <returns></returns>
    public extern void api_transmit(Point point);

    /// <summary>
    /// 单位强制传送到指定坐标
    /// </summary>
    /// <param name="pos"> 目标坐标 </param>
    /// <returns></returns>
    public extern void api_force_transmit(Point pos);

    /// <summary>
    /// 单位强制传送到指定坐标
    /// </summary>
    /// <param name="pos"> 目标坐标 </param>
    /// <param name="interpolation"> 是否平滑 </param>
    /// <returns></returns>
    public extern void api_force_transmit_new(Point pos,bool? interpolation);

    /// <summary>
    /// 单位设置朝向
    /// </summary>
    /// <param name="face_dir"> 朝向 </param>
    /// <param name="speed_effect"> 是否受转身速度影响 </param>
    /// <returns></returns>
    public extern void api_set_face_dir(Point face_dir,bool? speed_effect);

    /// <summary>
    /// 单位设置朝向角度
    /// </summary>
    /// <param name="face_angle"> 朝向角度 </param>
    /// <param name="turn_time_ms"> 转身时间毫秒 </param>
    /// <returns></returns>
    public extern void api_set_face_angle(Fix32 face_angle,int? turn_time_ms);

    /// <summary>
    /// 单位是否能传送到目标点
    /// </summary>
    /// <param name="pos"> 目标点 </param>
    /// <returns>单位是否能传送到目标点</returns>
    public extern bool? api_can_teleport_to(Point pos);

    /// <summary>
    /// 获取单位在目标点附近的最近可通行点
    /// </summary>
    /// <returns>最近可通行点</returns>
    public extern Point api_find_nearest_valid_position();

    /// <summary>
    /// 获取单位位置
    /// </summary>
    /// <returns>单位位置</returns>
    public extern Point api_get_position();

    /// <summary>
    /// 获取单位朝向
    /// </summary>
    /// <returns>单位朝向</returns>
    public extern Point api_get_face_dir();

    /// <summary>
    /// 获取单位面向角度
    /// </summary>
    /// <returns>单位面向角度</returns>
    public extern Fix32 get_face_angle();

    /// <summary>
    /// 设置单位转身速度
    /// </summary>
    /// <param name="turn_speed"> 转身速度 </param>
    /// <returns></returns>
    public extern void api_set_turn_speed(Fix32 turn_speed);

    /// <summary>
    /// 获得单位转身速度
    /// </summary>
    /// <returns>转身速度</returns>
    public extern Fix32 api_get_turn_speed();

    /// <summary>
    /// 单位是否在移动
    /// </summary>
    /// <returns>是否在移动</returns>
    public extern bool? api_is_moving();

    /// <summary>
    /// 设置单位是否计算某种碰撞类型
    /// </summary>
    /// <param name="collision_layer"> 碰撞mask </param>
    /// <param name="enable"> 开启状态 </param>
    /// <returns></returns>
    public extern void api_set_move_collision(int? collision_layer,bool? enable);

    /// <summary>
    /// 获取单位是否计算某种碰撞类型
    /// </summary>
    /// <param name="collision_layer"> 碰撞mask </param>
    /// <returns>是否开启</returns>
    public extern bool? api_get_move_collision(int? collision_layer);

    /// <summary>
    /// 设置单位的移动类型为地面
    /// </summary>
    /// <param name="land_limitation"> 陆地限制 </param>
    /// <param name="item_limitation"> 物件限制 </param>
    /// <param name="water_limitation"> 海洋限制 </param>
    /// <returns></returns>
    public extern void set_move_channel_land(bool? land_limitation,bool? item_limitation,bool? water_limitation);

    /// <summary>
    /// 设置单位的移动类型为空中
    /// </summary>
    /// <param name="air_limitation"> 空中限制 </param>
    /// <returns></returns>
    public extern void set_move_channel_air(bool? air_limitation);

    /// <summary>
    /// 获取单位从点到点的寻路距离
    /// </summary>
    /// <param name="point_start"> 单位 </param>
    /// <param name="point_end"> 起始点 </param>
    /// <returns></returns>
    public extern void get_unit_path_length_between_points(Unit point_start,Point point_end);

    /// <summary>
    /// 播放动画
    /// </summary>
    /// <param name="name"> 动画名称 </param>
    /// <param name="rate"> 播放倍率 </param>
    /// <param name="init_time"> 开始时间(s) </param>
    /// <param name="end_time"> 结束时间(s)，正数 -1 表示不结束 </param>
    /// <param name="loop"> 是否循环 </param>
    /// <param name="return_idle"> 播放结束后是否恢复idle </param>
    /// <returns></returns>
    public extern void api_play_animation(string name,double? rate,double? init_time,double? end_time,bool? loop,bool? return_idle);

    /// <summary>
    /// 停止播放动画
    /// </summary>
    /// <param name="name"> 动画名称 </param>
    /// <returns></returns>
    public extern void api_stop_animation(string name);

    /// <summary>
    /// 停止当前正在播放的动画
    /// </summary>
    /// <returns></returns>
    public extern void api_stop_cur_animation();

    /// <summary>
    /// 设置动画速度
    /// </summary>
    /// <param name="speed"> 速度 </param>
    /// <returns></returns>
    public extern void api_set_animation_speed(Fix32 speed);

    /// <summary>
    /// 单位播放特效
    /// </summary>
    /// <param name="socket_name"> 挂节点名字 </param>
    /// <param name="sfx_res_id"> 特效编号 </param>
    /// <param name="keep_time"> 持续时间，单位：秒 </param>
    /// <param name="scale"> 缩放比例 </param>
    /// <param name="inherit_pos"> 是否跟随单位位置 </param>
    /// <param name="inherit_rotate"> 是否跟随单位旋转 </param>
    /// <param name="inherit_scale"> 是否跟随缩放 </param>
    /// <param name="role"> 所属单位 </param>
    /// <param name="visible_type"> 可见性规则 </param>
    /// <param name="rotation"> 初始旋转 角度制 </param>
    /// <returns></returns>
    public extern void api_play_sfx(string socket_name,int? sfx_res_id,Fix32 keep_time,double? scale,bool? inherit_pos,bool? inherit_rotate,bool? inherit_scale,Role role,int? visible_type,double? rotation);

    /// <summary>
    /// 在单位挂接点播放特效
    /// </summary>
    /// <param name="socket_name"> 挂节点名字 </param>
    /// <param name="sfx_id"> 特效编号 </param>
    /// <param name="keep_time"> 持续时间，单位：秒 </param>
    /// <param name="scale"> 缩放比例 </param>
    /// <param name="inherit_rotate"> 是否跟随单位旋转 </param>
    /// <param name="inherit_scale"> 是否跟随缩放 </param>
    /// <param name="role"> 所属玩家 </param>
    /// <param name="visible_type"> 可见性规则 </param>
    /// <returns></returns>
    public extern void api_unit_play_sfx_on_socket(string socket_name,int? sfx_id,Fix32 keep_time,double? scale,bool? inherit_rotate,bool? inherit_scale,Role role,int? visible_type);

    /// <summary>
    /// 在单位上播放特效并返回特效实体
    /// </summary>
    /// <param name="socket_name"> 挂节点名字 </param>
    /// <param name="sfx_res_id"> 特效编号 </param>
    /// <param name="keep_time"> 持续时间，单位：秒 </param>
    /// <param name="scale"> 缩放比例 </param>
    /// <param name="inherit_pos"> 是否跟随单位位置 </param>
    /// <param name="inherit_rotate"> 是否跟随单位旋转 </param>
    /// <param name="inherit_scale"> 是否跟随缩放 </param>
    /// <param name="role"> 所属单位 </param>
    /// <param name="visible_type"> 可见性规则 </param>
    /// <param name="rotation"> 初始旋转 角度制 </param>
    /// <returns>特效</returns>
    public extern Sfx api_play_sfx_with_return(string socket_name,int? sfx_res_id,Fix32 keep_time,double? scale,bool? inherit_pos,bool? inherit_rotate,bool? inherit_scale,Role role,int? visible_type,double? rotation);

    /// <summary>
    /// 单位替换播放动画
    /// </summary>
    /// <param name="target_ani"> 目标动画名字 </param>
    /// <param name="source_ani"> 原动画名字 </param>
    /// <returns></returns>
    public extern void api_change_animation(string target_ani,string source_ani);

    /// <summary>
    /// 取消单位替换播放动画
    /// </summary>
    /// <param name="target_ani"> 目标动画名字 </param>
    /// <param name="source_ani"> 原动画名字 </param>
    /// <returns></returns>
    public extern void api_cancel_change_animation(string target_ani,string source_ani);

    /// <summary>
    /// 取消单位所有替换播放动画
    /// </summary>
    /// <param name="source_ani"> 原动画名字 </param>
    /// <returns></returns>
    public extern void api_clear_change_animation(string source_ani);

    /// <summary>
    /// 单位替换模型
    /// </summary>
    /// <param name="target_model"> 目标模型编号 </param>
    /// <param name="source_model"> 原模型编号 </param>
    /// <returns></returns>
    public extern void api_change_model(int? target_model,int? source_model);

    /// <summary>
    /// 取消单位替换模型
    /// </summary>
    /// <param name="target_model"> 目标模型编号 </param>
    /// <param name="source_model"> 原模型编号 </param>
    /// <returns></returns>
    public extern void api_cancel_change_model(int? target_model,int? source_model);

    /// <summary>
    /// 取消单位所有替换模型
    /// </summary>
    /// <param name="source_model"> 原模型编号 </param>
    /// <returns></returns>
    public extern void api_clear_change_model(int? source_model);

    /// <summary>
    /// 单位替换模型
    /// </summary>
    /// <param name="target_model"> 目标模型编号 </param>
    /// <returns></returns>
    public extern void api_replace_model(int? target_model);

    /// <summary>
    /// 取消单位替换模型
    /// </summary>
    /// <param name="target_model"> 目标模型名字 </param>
    /// <returns></returns>
    public extern void api_cancel_replace_model(int? target_model);

    /// <summary>
    /// 显示血条倒计时
    /// </summary>
    /// <param name="left_time"> 倒计时时长, 单位秒 </param>
    /// <returns></returns>
    public extern void api_show_health_bar_count_down(Fix32 left_time);

    /// <summary>
    /// 获取单位模型
    /// </summary>
    /// <returns>模型编号</returns>
    public extern int? api_get_model();

    /// <summary>
    /// 获取单位原模型
    /// </summary>
    /// <returns>模型编号</returns>
    public extern int? api_get_source_model();

    /// <summary>
    /// 显示单位头顶文本
    /// </summary>
    /// <param name="text"> 显示信息 </param>
    /// <param name="second"> 持续时间, 单位秒 </param>
    /// <param name="localize"> 多语言环境 </param>
    /// <returns></returns>
    public extern void api_show_text(string text,Fix32 second,int? localize);

    /// <summary>
    /// 更改单位称号
    /// </summary>
    /// <param name="title_str"> 称号 </param>
    /// <param name="localize"> 多语言转化 </param>
    /// <returns></returns>
    public extern void api_set_title(string title_str,bool? localize);

    /// <summary>
    /// 设置单位称号可见性
    /// </summary>
    /// <param name="visible"> 是否显示 </param>
    /// <returns></returns>
    public extern void api_set_title_visible(bool? visible);

    /// <summary>
    /// 隐藏显示单位名称,对于无头顶UI的单位该API不生效,每次隐藏计数+1,每次显示计数-1,计数归零显示单位名称
    /// </summary>
    /// <param name="visible"> 是否显示 </param>
    /// <returns></returns>
    public extern void api_set_name_visible(bool? visible);

    /// <summary>
    /// 隐藏显示单位名称,对于无头顶UI的单位该API不生效,每次隐藏计数+1,每次显示计数-1,计数归零显示单位名称
    /// </summary>
    /// <param name="visible"> 是否显示 </param>
    /// <returns></returns>
    public extern void api_set_bar_name_visible(bool? visible);

    /// <summary>
    /// 设置血条显示名字
    /// </summary>
    /// <param name="name"> 名字 </param>
    /// <returns></returns>
    public extern void api_set_bar_name(string name);

    /// <summary>
    /// 设置血条显示名字缩放
    /// </summary>
    /// <param name="scale"> 缩放 </param>
    /// <returns></returns>
    public extern void set_bar_name_scale(double? scale);

    /// <summary>
    /// 设置血条显示名字字体
    /// </summary>
    /// <param name="font_name"> 字体名称 </param>
    /// <returns></returns>
    public extern void api_set_bar_name_font_type(string font_name);

    /// <summary>
    /// 设置血条显示名字字体大小
    /// </summary>
    /// <param name="size"> 字号 </param>
    /// <returns></returns>
    public extern void api_set_bar_name_font_size(int? size);

    /// <summary>
    /// 隐藏显示单位头顶文本,每次隐藏计数+1,每次显示计数-1,计数归零显示单位头顶文本
    /// </summary>
    /// <param name="visible"> 是否显示 </param>
    /// <returns></returns>
    public extern void api_set_bar_text_visible(bool? visible);

    /// <summary>
    /// 设置头顶显示文字缩放
    /// </summary>
    /// <param name="scale"> 缩放 </param>
    /// <returns></returns>
    public extern void api_set_bar_text_scale(double? scale);

    /// <summary>
    /// 设置头顶显示文字类型
    /// </summary>
    /// <param name="bar_text_type"> 类型 </param>
    /// <returns></returns>
    public extern void api_set_bar_text_type(int? bar_text_type);

    /// <summary>
    /// 设置头顶显示文字字体
    /// </summary>
    /// <param name="font_type"> 字体 </param>
    /// <returns></returns>
    public extern void api_set_bar_text_font_type(string font_type);

    /// <summary>
    /// 设置头顶显示文字字号
    /// </summary>
    /// <param name="font_size"> 字号 </param>
    /// <returns></returns>
    public extern void api_set_bar_text_font_size(int? font_size);

    /// <summary>
    /// 设置血条名称显示样式
    /// </summary>
    /// <param name="t"> 样式,具体参见**HeadBarShowNameType** </param>
    /// <returns></returns>
    public extern void api_set_bar_name_show_type(int? t);

    /// <summary>
    /// 隐藏显示单位血条,对于无头顶UI的单位该API不生效,每次隐藏计数+1,每次显示计数-1,计数归零显示单位血条
    /// </summary>
    /// <param name="visible"> 是否显示 </param>
    /// <returns></returns>
    public extern void api_set_hp_bar_visible(bool? visible);

    /// <summary>
    /// 设置单位血条显示样式,对于无头顶UI的单位该API不生效
    /// </summary>
    /// <param name="t"> 显示样式,具体参见**HeadBarShowType** </param>
    /// <returns></returns>
    public extern void api_set_hp_bar_show_type(int? t);

    /// <summary>
    /// 设置单位血条样式,对于无头顶UI的单位该API不生效
    /// </summary>
    /// <param name="t"> 血条样式 </param>
    /// <returns></returns>
    public extern void api_set_hp_bar_type(int? t);

    /// <summary>
    /// 绑定UI控件
    /// </summary>
    /// <param name="ui_comp"> UI控件 </param>
    /// <param name="socket_name"> 挂接点(需确认模型拥有该挂接点,挂接点可在模型属性中查看,具体挂接点类型参见**ModelSocket**) </param>
    /// <returns></returns>
    public extern void api_add_ui_comp(string ui_comp,string socket_name);

    /// <summary>
    /// 修改单位称号字号
    /// </summary>
    /// <param name="font_size"> 字号 </param>
    /// <returns></returns>
    public extern void api_change_title_font_size(int? font_size);

    /// <summary>
    /// 修改单位称号缩放
    /// </summary>
    /// <param name="scale"> 缩放比例 </param>
    /// <returns></returns>
    public extern void api_change_title_scale(double? scale);

    /// <summary>
    /// 修改单位称号字体
    /// </summary>
    /// <param name="font_name"> 字体 </param>
    /// <returns></returns>
    public extern void api_change_title_font_type(string font_name);

    /// <summary>
    /// 修改单位称号样式
    /// </summary>
    /// <param name="style_type"> 称号样式 </param>
    /// <returns></returns>
    public extern void api_change_title_type(int? style_type);

    /// <summary>
    /// 修改单位称号背景不透明度
    /// </summary>
    /// <param name="opacity"> 不透明度 </param>
    /// <returns></returns>
    public extern void api_set_title_bg_opacity(double? opacity);

    /// <summary>
    /// 修改单位称号背景缩放
    /// </summary>
    /// <param name="scale"> 缩放 </param>
    /// <returns></returns>
    public extern void api_set_title_bg_scale(double? scale);

    /// <summary>
    /// 修改单位血条刻度可见性
    /// </summary>
    /// <param name="visible"> 可见性 </param>
    /// <returns></returns>
    public extern void api_set_blood_scale_visible(bool? visible);

    /// <summary>
    /// 修改单位称号位置偏移
    /// </summary>
    /// <param name="offset"> 位置偏移 </param>
    /// <returns></returns>
    public extern void api_set_title_bar_pos_offset(Point offset);

    /// <summary>
    /// 修改单位血条位置偏移
    /// </summary>
    /// <param name="offset"> 位置偏移 </param>
    /// <returns></returns>
    public extern void api_set_hp_bar_pos_offset(Point offset);

    /// <summary>
    /// 修改单位名称位置偏移
    /// </summary>
    /// <param name="offset"> 位置偏移 </param>
    /// <returns></returns>
    public extern void api_set_name_bar_pos_offset(Point offset);

    /// <summary>
    /// 修改单位文本位置偏移
    /// </summary>
    /// <param name="offset"> 位置偏移 </param>
    /// <returns></returns>
    public extern void api_set_text_bar_pos_offset(Point offset);

    /// <summary>
    /// 修改单位倒计时位置偏移
    /// </summary>
    /// <param name="offset"> 位置偏移 </param>
    /// <returns></returns>
    public extern void api_set_countdown_bar_pos_offset(Point offset);

    /// <summary>
    /// 单位抬高
    /// </summary>
    /// <param name="y"> 抬高高度 </param>
    /// <param name="dt"> 时间 </param>
    /// <returns></returns>
    public extern void api_raise_height(Fix32 y,Fix32 dt);

    /// <summary>
    /// 获取单位高度
    /// </summary>
    /// <returns>模型高度</returns>
    public extern Fix32 api_get_height();

    /// <summary>
    /// 设置单位缩放
    /// </summary>
    /// <param name="scale"> 缩放 </param>
    /// <returns></returns>
    public extern void api_set_scale(double? scale);

    /// <summary>
    /// 设置单位三轴缩放
    /// </summary>
    /// <param name="scale_x"> x缩放 </param>
    /// <param name="scale_y"> y缩放 </param>
    /// <param name="scale_z"> z缩放 </param>
    /// <returns></returns>
    public extern void api_set_unit_scale(double? scale_x,double? scale_y,double? scale_z);

    /// <summary>
    /// 获取单位缩放
    /// </summary>
    /// <returns>获取缩放</returns>
    public extern Fix32 api_get_scale();

    /// <summary>
    /// 获取单位模型缩放
    /// </summary>
    /// <returns>获取缩放</returns>
    public extern Fix32 api_get_model_scale();

    /// <summary>
    /// 修改单位血条样式
    /// </summary>
    /// <param name="blood_bar_type"> 血条样式 </param>
    /// <returns></returns>
    public extern void api_set_blood_bar_type(int? blood_bar_type);

    /// <summary>
    /// 修改单位血条显示模式
    /// </summary>
    /// <param name="blood_bar_show_type"> 血条显示模式 </param>
    /// <returns></returns>
    public extern void api_set_blood_bar_show_type(int? blood_bar_show_type);

    /// <summary>
    /// 开启残影
    /// </summary>
    /// <param name="r"> r </param>
    /// <param name="g"> g </param>
    /// <param name="b"> b </param>
    /// <param name="a"> a </param>
    /// <param name="interval"> interval </param>
    /// <param name="duration"> duration </param>
    /// <param name="start"> start </param>
    /// <param name="end_"> end </param>
    /// <param name="use_raw_texture"> Use origin texture </param>
    /// <returns></returns>
    public extern void api_start_ghost(Fix32 r,Fix32 g,Fix32 b,Fix32 a,Fix32 interval,Fix32 duration,Fix32 start,Fix32 end_,bool? use_raw_texture);

    /// <summary>
    /// 关闭残影
    /// </summary>
    /// <returns></returns>
    public extern void api_stop_ghost();

    /// <summary>
    /// 开始溶解效果
    /// </summary>
    /// <param name="dissolve_time"> 溶解时间 </param>
    /// <param name="sink_dis"> 下沉距离 </param>
    /// <returns></returns>
    public extern void api_start_dissolve(Fix32 dissolve_time,Fix32 sink_dis);

    /// <summary>
    /// 关闭溶解效果
    /// </summary>
    /// <returns></returns>
    public extern void api_stop_dissolve();

    /// <summary>
    /// 设置残影颜色
    /// </summary>
    /// <param name="r"> r </param>
    /// <param name="g"> g </param>
    /// <param name="b"> b </param>
    /// <param name="a"> a </param>
    /// <returns></returns>
    public extern void api_set_ghost_color(Fix32 r,Fix32 g,Fix32 b,Fix32 a);

    /// <summary>
    /// 设置残影时间
    /// </summary>
    /// <param name="interval"> interval </param>
    /// <param name="duration"> duration </param>
    /// <param name="start"> start </param>
    /// <param name="end_"> end </param>
    /// <returns></returns>
    public extern void api_set_ghost_time(Fix32 interval,Fix32 duration,Fix32 start,Fix32 end_);

    /// <summary>
    /// 对单位所属玩家关系播放音乐
    /// </summary>
    /// <param name="camp_target"> 玩家关系 </param>
    /// <param name="sid"> 乐曲编号 </param>
    /// <param name="loop"> 是否循环 </param>
    /// <returns></returns>
    public extern void api_play_sound_by_unit_for_role_relation(int? camp_target,int? sid,bool? loop);

    /// <summary>
    /// 设置XRay是否开启
    /// </summary>
    /// <param name="value"> 布尔值 </param>
    /// <returns></returns>
    public extern void api_set_Xray_is_open(bool? value);

    /// <summary>
    /// 设置单位隐身被探测到时是否半透明
    /// </summary>
    /// <param name="value"> 布尔值 </param>
    /// <returns></returns>
    public extern void api_set_transparent_when_invisible(bool? value);

    /// <summary>
    /// 设置单位小地图头像
    /// </summary>
    /// <param name="icon"> 图片 </param>
    /// <returns></returns>
    public extern void api_set_mini_map_icon(int? icon);

    /// <summary>
    /// 设置敌方单位小地图头像
    /// </summary>
    /// <param name="icon"> 图片 </param>
    /// <returns></returns>
    public extern void api_set_enemy_mini_map_icon(int? icon);

    /// <summary>
    /// 设置单位选择框的可见性
    /// </summary>
    /// <param name="value"> 布尔值 </param>
    /// <returns></returns>
    public extern void api_set_unit_select_effect_visible(bool? value);

    /// <summary>
    /// 开关阴阳师模型IDLE时看向摄像机是否开启
    /// </summary>
    /// <param name="role"> 玩家 </param>
    /// <param name="value"> 布尔值 </param>
    /// <returns></returns>
    public extern void api_active_gm1_look_at_camera(Role role,bool? value);

    /// <summary>
    /// 设置单位圆盘阴影开关
    /// </summary>
    /// <param name="is_open"> 布尔值 </param>
    /// <returns></returns>
    public extern void api_set_disk_shadow_open(bool? is_open);

    /// <summary>
    /// 设置单位圆盘阴影大小
    /// </summary>
    /// <param name="shadow_size"> 大小 </param>
    /// <returns></returns>
    public extern void api_set_unit_disk_shadow_size(double? shadow_size);

    /// <summary>
    /// 单位添加指定编号的效果
    /// </summary>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <param name="from_unit"> 来源单位对象 </param>
    /// <param name="from_ability"> 关联技能 </param>
    /// <param name="time"> 持续时间 </param>
    /// <param name="cycle_time"> 循环周期 </param>
    /// <param name="stack_count"> 效果层数 </param>
    /// <returns>魔法效果</returns>
    public extern ModifierEntity api_add_modifier(int? modifier_key,Unit from_unit,Ability from_ability,Fix32 time,Fix32 cycle_time,int? stack_count);

    /// <summary>
    /// 获取单位身上指定编号的的效果层数
    /// </summary>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <returns>效果层数</returns>
    public extern int? api_get_modifier_stack_count(int? modifier_key);

    /// <summary>
    /// 单位身上是否拥有指定编号的效果
    /// </summary>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <returns>单位身上是否有指定编号的效果</returns>
    public extern bool? api_has_modifier(int? modifier_key);

    /// <summary>
    /// 单位身上是否拥有指定标签的效果
    /// </summary>
    /// <param name="tag"> 标签 </param>
    /// <returns>单位身上是否拥有指定标签的效果</returns>
    public extern bool? api_has_modifier_with_tag(string tag);

    /// <summary>
    /// 获取单位身上指定编号的第i个效果实例
    /// </summary>
    /// <param name="add_index"> 效果位置 </param>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <returns></returns>
    public extern void api_get_modifier(int? add_index,int? modifier_key);

    /// <summary>
    /// 获取单位身上指定编号的第i个效果的个数
    /// </summary>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <returns></returns>
    public extern void api_get_modifier_count(int? modifier_key);

    /// <summary>
    /// 移除目标单位身上的目标modifier实例
    /// </summary>
    /// <param name="tar_modifier"> 效果编号 </param>
    /// <returns></returns>
    public extern void api_remove_modifier_instance(ModifierEntity tar_modifier);

    /// <summary>
    /// 移除目标单位身上的目标modifier类型的所有实例
    /// </summary>
    /// <param name="modifier_key"> 效果编号 </param>
    /// <returns></returns>
    public extern void api_remove_modifier_type(int? modifier_key);

    /// <summary>
    /// 单位身上是否拥有指定类别的效果
    /// </summary>
    /// <param name="modifier_effect_type"> 魔法效果类型 </param>
    /// <returns>单位身上是否拥有指定类型的魔法效果</returns>
    public extern bool? api_has_modifier_type(int? modifier_effect_type);

    /// <summary>
    /// 删除单位指定影响类型的魔法效果
    /// </summary>
    /// <param name="effect_type"> 效果影响类型 </param>
    /// <returns></returns>
    public extern void api_delete_all_modifiers_by_effect_type(int? effect_type);

    /// <summary>
    /// 获取单位身上所有的魔法效果
    /// </summary>
    /// <returns>魔法效果</returns>
    public extern ModifierEntity api_get_all_modifiers();

    /// <summary>
    /// 单位添加技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_id"> 技能编号 </param>
    /// <param name="ability_index"> 技能槽位编号 </param>
    /// <param name="ability_level"> 技能等级 </param>
    /// <returns>技能</returns>
    public extern Ability api_add_ability(int? ability_type,int? ability_id,int? ability_index,int? ability_level);

    /// <summary>
    /// 单位根据槽位移除技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <returns></returns>
    public extern void api_remove_ability_by_index(int? ability_type,int? ability_index);

    /// <summary>
    /// 单位移除某种类型里所有是指定技能ID的技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_id"> 技能ID </param>
    /// <returns></returns>
    public extern void api_remove_abilities_in_type(int? ability_type,int? ability_id);

    /// <summary>
    /// 单位设置技能等级。
    /// </summary>
    /// <param name="modify"> 修改方式 </param>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <param name="level"> 技能等级 </param>
    /// <returns></returns>
    public extern void api_set_ability_level(int? modify,int? ability_type,int? ability_index,int? level);

    /// <summary>
    /// 单位学习技能
    /// </summary>
    /// <param name="ability_key"> 技能类型 </param>
    /// <returns></returns>
    public extern void api_unit_learn_ability(int? ability_key);

    /// <summary>
    /// 获取英雄的技能点
    /// </summary>
    /// <returns>技能点</returns>
    public extern int? api_get_ability_point();

    /// <summary>
    /// 设置英雄的技能点
    /// </summary>
    /// <param name="ability_point"> 技能点 </param>
    /// <returns></returns>
    public extern void api_set_ability_point(int? ability_point);

    /// <summary>
    /// 增加英雄的技能点
    /// </summary>
    /// <param name="value"> 技能点 </param>
    /// <returns></returns>
    public extern void api_add_ability_point(int? value);

    /// <summary>
    /// 通过技能槽位获取技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <returns>技能对象</returns>
    public extern Ability api_get_ability(int? ability_type,int? ability_index);

    /// <summary>
    /// 通过技能类型加技能ID获取技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_id"> 技能编号 </param>
    /// <returns>技能对象</returns>
    public extern Ability api_get_ability_by_type(int? ability_type,int? ability_id);

    /// <summary>
    /// 获取某种类型的技能列表
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <returns>技能对象</returns>
    public extern Ability api_get_abilities_by_type(int? ability_type);

    /// <summary>
    /// 是否有对应技能类型的技能
    /// </summary>
    /// <param name="ability_id"> 技能类型 </param>
    /// <returns>是否有对应技能类型的技能</returns>
    public extern bool? api_check_has_ability_type(int? ability_id);

    /// <summary>
    /// 获取单位技能列表
    /// </summary>
    /// <returns>技能对象</returns>
    public extern Ability api_get_all_abilities_can_show();

    /// <summary>
    /// 根据坑位交换技能
    /// </summary>
    /// <param name="ability_1_type"> 技能类型 </param>
    /// <param name="ability_1_index"> 技能槽位 </param>
    /// <param name="ability_2_type"> 技能类型 </param>
    /// <param name="ability_2_index"> 技能槽位 </param>
    /// <returns></returns>
    public extern void api_switch_ability_by_index(int? ability_1_type,int? ability_1_index,int? ability_2_type,int? ability_2_index);

    /// <summary>
    /// 交换技能
    /// </summary>
    /// <param name="ability_1"> 技能 </param>
    /// <param name="ability_2"> 技能 </param>
    /// <returns></returns>
    public extern void api_switch_ability(Ability ability_1,Ability ability_2);

    /// <summary>
    /// 单位禁用技能。
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <returns></returns>
    public extern void api_disable_ability(int? ability_type,int? ability_index);

    /// <summary>
    /// 单位解禁技能。
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <returns></returns>
    public extern void api_enable_ability(int? ability_type,int? ability_index);

    /// <summary>
    /// 停止单位所有技能
    /// </summary>
    /// <returns></returns>
    public extern void api_stop_all_abilities();

    /// <summary>
    /// 单位是否有正在释放的技能
    /// </summary>
    /// <returns>是否有正在释放的技能</returns>
    public extern bool? api_unit_has_running_ability();

    /// <summary>
    /// 返回单位实体指定槽位技能的字符串属性值
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <param name="prop"> 属性名 </param>
    /// <returns>字符</returns>
    public extern string api_get_ability_str_attr_value(int? ability_type,int? ability_index,string prop);

    /// <summary>
    /// 根据技能序号获取技能对象
    /// </summary>
    /// <param name="seq"> 技能序号 </param>
    /// <returns>技能对象</returns>
    public extern Ability api_get_ability_by_seq(int? seq);

    /// <summary>
    /// 给单位施加状态
    /// </summary>
    /// <param name="state_id"> 状态ID </param>
    /// <returns></returns>
    public extern void api_add_state(int? state_id);

    /// <summary>
    /// 给单位去除状态
    /// </summary>
    /// <param name="state_id"> 状态ID </param>
    /// <returns></returns>
    public extern void api_remove_state(int? state_id);

    /// <summary>
    /// 是否在战斗状态
    /// </summary>
    /// <returns>是否在战斗状态</returns>
    public extern bool? api_is_in_battle_state();

    /// <summary>
    /// 单位是否处于某状态
    /// </summary>
    /// <param name="state_bit"> 状态 </param>
    /// <returns>单位是否处于某状态</returns>
    public extern bool? api_has_state(int? state_bit);

    /// <summary>
    /// 单位施放技能
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能槽位 </param>
    /// <returns></returns>
    public extern void api_release_ability_by_index(int? ability_type,int? ability_index);

    /// <summary>
    /// 单位施放技能，具有释放目标地点
    /// </summary>
    /// <param name="ability_type"> 技能类型 </param>
    /// <param name="ability_index"> 技能坑位 </param>
    /// <param name="postion"> 技能目标位置 </param>
    /// <returns></returns>
    public extern void api_release_ability_at_position(int? ability_type,int? ability_index,Point postion);

    /// <summary>
    /// 发布建造命令(目标点)
    /// </summary>
    /// <param name="build_key"> 建筑类型 </param>
    /// <param name="point"> 目标位置 </param>
    /// <returns></returns>
    public extern void api_create_building_on_point(int? build_key,Point point);

    /// <summary>
    /// 发布建造命令(坐标)
    /// </summary>
    /// <param name="build_key"> 建筑类型 </param>
    /// <param name="pos_x"> 坐标X </param>
    /// <param name="pos_z"> 坐标Z </param>
    /// <returns></returns>
    public extern void api_create_building_on_position(int? build_key,Fix32 pos_x,Fix32 pos_z);

    /// <summary>
    /// 单位是否拥有物品
    /// </summary>
    /// <param name="item"> 物品 </param>
    /// <returns>单位是否拥有物品</returns>
    public extern bool? api_has_item(Item item);

    /// <summary>
    /// 单位是否拥有特定编号物品
    /// </summary>
    /// <param name="item_no"> 物品编号 </param>
    /// <returns>单位是否拥有特定编号物品</returns>
    public extern bool? api_has_item_key(int? item_no);

    /// <summary>
    /// 给单位添加物品名
    /// </summary>
    /// <param name="item_no"> 物品编号 </param>
    /// <returns>创建的物品实体</returns>
    public extern Item api_add_item(int? item_no);

    /// <summary>
    /// 给单位删除物品名
    /// </summary>
    /// <param name="item_key"> 物品编号 </param>
    /// <param name="num"> 数量 </param>
    /// <returns></returns>
    public extern void api_delete_item(int? item_key,int? num);

    /// <summary>
    /// 单位丢弃物品实体到场景中
    /// </summary>
    /// <param name="item"> 物品 </param>
    /// <param name="pos"> 点 </param>
    /// <param name="stack_cnt"> 数量 </param>
    /// <returns></returns>
    public extern void api_drop_item(Item item,Point pos,int? stack_cnt);

    /// <summary>
    /// 单位删除物品实体
    /// </summary>
    /// <param name="stack_cnt"> 数量 </param>
    /// <param name="item"> 物品 </param>
    /// <returns></returns>
    public extern void api_remove_item(int? stack_cnt,Item item);

    /// <summary>
    /// 获取单位背包槽位的物品
    /// </summary>
    /// <param name="slot_type"> 背包槽位 </param>
    /// <param name="slot_idx"> 格子下标 </param>
    /// <returns>物品对象</returns>
    public extern Item api_get_item_by_slot(int? slot_type,int? slot_idx);

    /// <summary>
    /// 移动物品
    /// </summary>
    /// <param name="item"> 物品 </param>
    /// <param name="slot_type"> 背包槽位 </param>
    /// <param name="slot_idx"> 格子下标 </param>
    /// <returns></returns>
    public extern void api_shift_item(Item item,int? slot_type,int? slot_idx);

    /// <summary>
    /// 移动物品
    /// </summary>
    /// <param name="item"> 物品 </param>
    /// <param name="slot_type"> 背包槽位 </param>
    /// <param name="slot_idx"> 格子下标 </param>
    /// <param name="is_force_shift"> 格子被占是否转移 </param>
    /// <returns></returns>
    public extern void api_shift_item_new(Item item,int? slot_type,int? slot_idx,bool? is_force_shift);

    /// <summary>
    /// 单位身上所有物品
    /// </summary>
    /// <returns>物品组</returns>
    public extern ItemGroup api_get_all_item_pids();

    /// <summary>
    /// 设置单位物品栏的格子数量
    /// </summary>
    /// <param name="cnt"> 个数 </param>
    /// <returns></returns>
    public extern void api_set_unit_bar_cnt(int? cnt);

    /// <summary>
    /// 设置单位背包栏的格子数量
    /// </summary>
    /// <param name="cnt"> 个数 </param>
    /// <returns></returns>
    public extern void api_set_unit_pkg_cnt(int? cnt);

    /// <summary>
    /// 单位身上拥有指定类型的物品数量
    /// </summary>
    /// <param name="item_type"> 物品编号 </param>
    /// <returns>数量</returns>
    public extern int? api_get_num_of_item_type(int? item_type);

    /// <summary>
    /// 获取单位持有的物品类型
    /// </summary>
    /// <param name="slot_type"> 槽位类型 </param>
    /// <param name="slot_idx"> 整数下标 </param>
    /// <returns>物品编号</returns>
    public extern int? api_get_item_type_by_slot(int? slot_type,int? slot_idx);

    /// <summary>
    /// 单位是否商店
    /// </summary>
    /// <returns>单位是否商店</returns>
    public extern bool? api_is_shop();

    /// <summary>
    /// 获取商店单位范围
    /// </summary>
    /// <returns>商店范围</returns>
    public extern Fix32 api_get_shop_range();

    /// <summary>
    /// 添加物品商品到商店
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="item_no"> 道具编号 </param>
    /// <returns></returns>
    public extern void api_add_shop_item(string tab_name,int? item_no);

    /// <summary>
    /// 获取商店某页签的商品列表
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <returns>道具编号</returns>
    public extern dynamic api_get_shop_item_list(int? tab_idx);

    /// <summary>
    /// 获取商店商品的恢复时间
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_no"> 道具编号 </param>
    /// <returns></returns>
    public extern void api_get_shop_item_cd(int? tab_idx,int? item_no);

    /// <summary>
    /// 获取商店商品的库存恢复间隔
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_num"> 第N个道具 </param>
    /// <returns>恢复间隔</returns>
    public extern Fix32 api_get_shop_item_default_cd(int? tab_idx,int? item_num);

    /// <summary>
    /// 获取商店商品的剩余恢复时间
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_num"> 第N个道具 </param>
    /// <returns>恢复间隔</returns>
    public extern Fix32 api_get_shop_item_residual_cd(int? tab_idx,int? item_num);

    /// <summary>
    /// 获取商店页签数量
    /// </summary>
    /// <returns>页签数量</returns>
    public extern int? api_get_shop_tab_cnt();

    /// <summary>
    /// 获取商店的页签名
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <returns>页签名</returns>
    public extern string api_get_shop_tab_name(int? tab_idx);

    /// <summary>
    /// 获取商店指定页签第N个商品的类型
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_idx"> 商品编号 </param>
    /// <returns>物品类型</returns>
    public extern int? api_get_shop_tab_item_type(int? tab_idx,int? item_idx);

    /// <summary>
    /// 添加单位商品到商店
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <returns></returns>
    public extern void api_add_shop_unit(string tab_name,int? entity_no);

    /// <summary>
    /// 删除商店物品商品
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="item_no"> 道具编号 </param>
    /// <returns></returns>
    public extern void api_remove_shop_item(string tab_name,int? item_no);

    /// <summary>
    /// 删除商店单位商品
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <returns></returns>
    public extern void api_remove_shop_unit(string tab_name,int? entity_no);

    /// <summary>
    /// 设置物品商品库存
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="item_no"> 道具编号 </param>
    /// <param name="cnt"> 库存 </param>
    /// <returns></returns>
    public extern void api_set_shop_item_stock(string tab_name,int? item_no,int? cnt);

    /// <summary>
    /// 设置单位商品库存
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <param name="cnt"> 库存 </param>
    /// <returns></returns>
    public extern void api_set_shop_unit_stock(string tab_name,int? entity_no,int? cnt);

    /// <summary>
    /// 设置商店开关
    /// </summary>
    /// <param name="is_shop"> 开关 </param>
    /// <returns></returns>
    public extern void api_set_is_shop(bool? is_shop);

    /// <summary>
    /// 单位购买物品
    /// </summary>
    /// <param name="shop_unit"> 商店 </param>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_no"> 物品编号 </param>
    /// <returns></returns>
    public extern void api_buy_item_with_tab_name(Unit shop_unit,int? tab_idx,int? item_no);

    /// <summary>
    /// 单位购买单位
    /// </summary>
    /// <param name="shop_unit"> 商店 </param>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <returns></returns>
    public extern void api_buy_unit_with_tab_name(Unit shop_unit,string tab_name,int? entity_no);

    /// <summary>
    /// 单位出售物品
    /// </summary>
    /// <param name="shop_unit"> 商店 </param>
    /// <param name="item"> 道具 </param>
    /// <returns></returns>
    public extern void api_sell_item(Unit shop_unit,Item item);

    /// <summary>
    /// 设置商店目标
    /// </summary>
    /// <param name="target_unit"> 目标 </param>
    /// <returns></returns>
    public extern void api_set_shop_target(Unit target_unit);

    /// <summary>
    /// 获取单位商店物品商品库存
    /// </summary>
    /// <param name="tab_idx"> 页签id </param>
    /// <param name="item_no"> 物品编号 </param>
    /// <returns>商品库存</returns>
    public extern int? api_get_shop_item_stock(int? tab_idx,int? item_no);

    /// <summary>
    /// 获取单位商店单位商品库存
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <returns>商品库存</returns>
    public extern int? api_get_shop_unit_stock(string tab_name,int? entity_no);

    /// <summary>
    /// 获取单位商店单位商品售价
    /// </summary>
    /// <param name="tab_name"> 页签 </param>
    /// <param name="entity_no"> 单位编号 </param>
    /// <returns>商品售价</returns>
    public extern Fix32 api_get_shop_item_price(string tab_name,int? entity_no);

    /// <summary>
    /// 玩家是否可以购买商店的物品
    /// </summary>
    /// <param name="role"> 玩家 </param>
    /// <returns>能否购买</returns>
    public extern bool? api_shop_check_camp(Role role);

    /// <summary>
    /// 科技升级
    /// </summary>
    /// <param name="tech_no"> 科技编号 </param>
    /// <returns></returns>
    public extern void api_upgrade_tech(int? tech_no);

    /// <summary>
    /// 获取科技列表
    /// </summary>
    /// <returns>科技编号</returns>
    public extern dynamic api_get_tech_list();

    /// <summary>
    /// 获取科技列表
    /// </summary>
    /// <returns>科技编号</returns>
    public extern dynamic api_get_affect_techs();

    /// <summary>
    /// 获取科技是否满足前置条件
    /// </summary>
    /// <param name="tech_no"> 科技编号 </param>
    /// <returns>科技编号</returns>
    public extern int? api_check_tech_precondition(int? tech_no);

    /// <summary>
    /// 添加科技
    /// </summary>
    /// <param name="tech_no"> 科技编号 </param>
    /// <returns></returns>
    public extern void api_add_tech(int? tech_no);

    /// <summary>
    /// 删除科技
    /// </summary>
    /// <param name="tech_no"> 科技编号 </param>
    /// <returns></returns>
    public extern void api_remove_tech(int? tech_no);

    /// <summary>
    /// 发布命令
    /// </summary>
    /// <param name="command"> 命令 </param>
    /// <returns></returns>
    public extern void api_release_command(string command);

    /// <summary>
    /// 设置单位默认跳转状态
    /// </summary>
    /// <param name="behavior"> 默认跳转状态 </param>
    /// <returns></returns>
    public extern void api_set_default_switch_behavior(dynamic behavior);

}
